import {
    handleRequest
} from './index';
import request2 from '@/utils/request2'
import { safetyApiUrl } from '@/api/config'

// 获取-安全制度管理列表
export function getSystemManageList(data) {
    return handleRequest({
        url: '/safety-service/safety-manage/query',
        method: 'post',
        data
    })
}

// 查看-安全制度管理详情
export function getSystemManageDetail(query) {
    return handleRequest({
        url: '/safety-service/safety-manage/query',
        method: 'get',
        params: query
    })
}

// 新增-安全管理制度
export function addSystemManage(data, config) {
    return handleRequest({
        url: '/safety-service/safety-manage',
        method: 'post',
        data,
    }, config)
}

///leadership-takeshift/produce-recording/del
//删除-领导带班生产记录
export function produceRecordingDel(params, config) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/del/'+params.id,
        method: 'get',
        params,
    }, config)
}

// 删除-安全管理制度
export function deleteSystemManage(query) {
    return handleRequest({
        url: '/safety-service/safety-manage/del',
        method: 'post',
        params: query
    })
}

// 修改-安全管理制度
export function updateSystemManage(data) {
    return handleRequest({
        url: '/safety-service/safety-manage/update',
        method: 'post',
        data
    })
}

// 获取-安全制度分类列表
export function getSystemClassifyList(data) {
    return handleRequest({
        url: '/safety-service/type-manage/list',
        method: 'post',
        data
    })
}

// 查看-安全制度分类详情
export function getSystemClassifyDetail(query) {
    return handleRequest({
        url: '/safety-service/type-manage',
        method: 'get',
        params: query
    })
}

// 新增-安全制度分类
export function addSystemClassify(data) {
    return handleRequest({
        url: '/safety-service/type-manage',
        method: 'post',
        data
    })
}

// 修改-安全制度分类
export function updateSystemClassify(data) {
    return handleRequest({
        url: '/safety-service/type-manage/update',
        method: 'post',
        data
    })
}

// 获取-领导带班生产记录列表
export function getProductionRecordList(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/list',
        method: 'post',
        data
    })
}

// 获取-项目经理带班生产记录列表
export function getPMRecordList(data) {
    return handleRequest({
        url: '/project-manager/take-shift/list',
        method: 'post',
        data
    })
}

//project-manager/take-shift/del
// 删除
export function delPm(params) {
    return request2({
        url: safetyApiUrl + '/project-manager/take-shift/del/'+params.id,
        method: 'get',
        params
    })
}

// 查看-领导带班生产记录详情
export function getProductionRecordDetail(query) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording',
        method: 'get',
        params: query
    })
}


//打印-领导带班生产记录详情
export function getProductionRecordDetailPrint(query) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/print',
        method: 'get',
        params: query
    })
}

// 查询-领导带班生产记录(打卡)
export function getMouthRecord(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/getTakeShiftRecords',
        method: 'post',
        data
    })
}
// 领导带班-项目经理带班安全检查落实情况求-月整体情况
export function getManagerListDate(data) {
    return request2({
        url: '/cscec-pms-app-business/safetyTaskShift/pmShiftMonth',
        method: 'post',
        data
    })
}
// 领导带班-下级单位领导带班安全检查落实情况求-月整体情况
export function getLeadersRecordDate(data) {
    return request2({
        url: '/cscec-pms-app-business/safetyTaskShift/jLeaderShiftMonth',
        method: 'post',
        data
    })
}
// 领导带班-下级单位领导带班安全检查落实情况求-详情
export function getLeadersRecordDateDetail(data) {
    return request2({
        url: '/cscec-pms-app-business/safetyTaskShift/jLeaderShifDetail',
        method: 'post',
        data
    })
}

// 查询当前项目、所选日期的带班记录
export function findPmTakeShift(data) {
    return request2({
        url: '/cscec-pms-app-business/safetyTaskShift/findPmTakeShift',
        method: 'post',
        data
    })
}


// 查询-项目经理/执行经理带班生产记录(打卡)
export function getPMMouthRecord(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/getProjectTakeShiftRecords',
        method: 'post',
        data
    })
}
// 查看-领导带班生产记录详情
export function getPMDetail(query) {
    return handleRequest({
        url: '/project-manager/take-shift/query',
        method: 'get',
        params: query
    })
}



// 查看-领导带班生产记录日期列表
export function getLeaderDates(params) {
    return handleRequest({
        url: '/pmTakeShift/leaderDates/' + params,
        method: 'get',

    }, {
        useApp: true
    })
}
// 获取-获取形象进度
export function getTypeLabel() {
    return handleRequest({
        url: '/pmTakeShift/typeLabel',
        method: 'get',

    }, {
        useApp: true
    })
}


// 打印-领导带班生产记录详情
export function getPMDetailPrint(query) {
    return handleRequest({
        url: '/project-manager/take-shift/query/print',
        method: 'get',
        params: query
    })
}

// 新增-领导带班生产记录
export function addProductionRecord(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording',
        method: 'post',
        data
    })
}
// 领导带班-整改回复
export function pmReplay(data) {
    return handleRequest({
        url: '/leadership-takeshift/pmReplay',
        method: 'post',
        data
    })
}
//
// 查询当月的项目的一二级风险清单
export function findInventorys(params) {
    return handleRequest({
        url: '/leadership-takeshift/findInventorys',
        method: 'get',
      params
    })
}
//
export function replyUser(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/replyUser',
        method: 'post',
      data
    })
}

// 新增-PM带班生产记录
export function addPMProductionRecord(data) {
    return handleRequest({
        url: '/pmTakeShift',
        method: 'post',
        data
    }, {
        useApp: true
    })
}

// // 修改-领导带班生产记录
// export function updatePMProductionRecord(data) {
//     return handleRequest({
//         url: '/pmTakeShift',
//         method: 'post',
//         data
//     })
// }

// 修改-领导带班生产记录
export function updateProductionRecord(data) {
    return handleRequest({
        url: '/leadership-takeshift/produce-recording/update',
        method: 'post',
        data
    })
}

// 删除-安全管理制度
export function deleteProductionRecord(query) {
    return handleRequest({
        url: '/safety-service/safety-manage/del',
        method: 'post',
        params: query
    })
}
// 安全制度管理列表统计
export function GetCount(data) {
  return handleRequest({
    url: '/safety-service/count',
    method: 'post',
    data
  })
}
// 领导带班列表统计
export function GetcountLeadership(data) {
  return handleRequest({
    url: '/leadership-takeshift/count',
    method: 'post',
    data
  })
}
// 领导带班验收回复
export function stayAcceptance(data) {
    return handleRequest({
      url: '/leadership-takeshift/stayAcceptance',
      method: 'post',
      data
    })
  }
  // 领导带班 导出pdf
export function getExportHtml(data) {
    return handleRequest({
      url: '/leadership-takeshift/getExportHtml',
      method: 'post',
      data
    })
  }